package aboa.club;

import java.util.ArrayList;

public class Member extends AbstractPerson implements IMember {
	
	IMembership membership;
	ArrayList<IActivity> activities;
	String memberid;
	
	public Member(IMembership membership, String name, String street,
			String zip, String city, String memberid) {
		super(name, street,zip, city);
		this.membership = membership;
		this.activities = new ArrayList<IActivity>();
		this.memberid= memberid;
	}

	@Override
	public String getMemberID() {
		// TODO Auto-generated method stub
		return memberid;
	}

	@Override
	public IMembership getMembership() {
		// TODO Auto-generated method stub
		return membership;
	}

	@Override
	public ArrayList<IActivity> getSports() {
		// TODO Auto-generated method stub
		return activities;
	}

	@Override
	public boolean addActivity(IActivity activity) {
		// TODO Auto-generated method stub
		if (!activities.contains(activity))
			{
			activities.add(activity);
			return true;
			}
		else return false;
	}

	@Override
	public double getMonthlyFee() {
		// TODO Auto-generated method stub
		double fee= membership.getBaseCost();
		for(int x=0;x<activities.size();x++)
		{
			fee+=membership.getDiscount()*activities.get(x).getPrice();
		}
		return fee;
	}

	
}
